<script setup>
const onClickLeft = () => history.back();
const props = defineProps({
  title: {
    type: String,
    default: '标题'
  },
  leftText: {
    type: String,
    default: ''
  },
  rightText: {
    type: String,
    default: ''
  },
  rightArrow: {
    type: Boolean,
    default: false
  },
  leftArrow:{
    type: Boolean,
    default: false
  }

});
</script>

<template>
  <div class="sticky-navbar">
    <van-nav-bar
      :title="title"
      :left-text="leftText"
      :right-text="rightText"
      :right-arrow="rightArrow"
      :left-arrow="leftArrow"
      @click-left="onClickLeft"
    />
  </div>
</template>

<style scoped>
.sticky-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}
</style>